package com.then.basic.socket.core.error;

/**
 *
 * Created by longyi on 16/7/27.
 */
public class CommonError {
    public static class NetworkErrorInfo {
        public enum ErrorType {
            NetworkNotAvailable,
            ConnectServerFail,
            SendPackageFail,
            ReadPackageFail,
            ReadSocketDisconnected,
        }
        public ErrorType errorType;
        public int serverType;
        public int offlineCheckCount; // 已经连续多少次检测到超时了
        public NetworkErrorInfo(ErrorType errorType, int serverType, int offlineCheckCount) {
            this.errorType = errorType;
            this.serverType = serverType;
            this.offlineCheckCount = offlineCheckCount;
        }
        public final static NetworkErrorInfo NetworkNotAvailableMessage = new NetworkErrorInfo(
                ErrorType.NetworkNotAvailable, 0, 0);
        public final static NetworkErrorInfo ConnectServerFailMessage = new NetworkErrorInfo(
                ErrorType.ConnectServerFail, 0, 0);
    }
}
